<template>
  <el-container>
    <el-aside width="200px">
      <el-menu style="height: 88vh;margin-right: 10px" :default-active="menuDefaultSelectIndex" @select="selectMenu">
        <el-menu-item style="align-content:center" index="2">
          <el-icon>
            <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
              <path fill="#000000"
                    d="m19.05 21.6l-2.925-2.9l-1.5 1.5q-.275.275-.7.275t-.7-.275q-.575-.575-.575-1.425t.575-1.425l4.225-4.225q.575-.575 1.425-.575t1.425.575q.275.275.275.7t-.275.7l-1.5 1.5l2.9 2.925q.3.3.3.7t-.3.7l-1.25 1.25q-.3.3-.7.3t-.7-.3M21.7 6.2L10.65 17.25l.125.1q.575.575.575 1.425t-.575 1.425q-.275.275-.7.275t-.7-.275l-1.5-1.5l-2.925 2.9q-.3.3-.7.3t-.7-.3L2.3 20.35q-.3-.3-.3-.7t.3-.7l2.9-2.925l-1.5-1.5q-.275-.275-.275-.7t.275-.7q.575-.575 1.425-.575t1.425.575l.1.125L17.425 2.475q.275-.275.638-.425t.762-.15H21q.425 0 .713.288T22 2.9v2.575q0 .2-.075.388T21.7 6.2M6.225 10.125l-3.65-3.65Q2.3 6.2 2.15 5.838T2 5.075V2.9q0-.425.288-.712T3 1.9h2.175q.4 0 .763.15t.637.425l3.65 3.65q.3.3.3.713t-.3.712L7.65 10.125q-.3.3-.712.3t-.713-.3"></path>
            </svg>
          </el-icon>
          装备管理
        </el-menu-item>
        <el-menu-item style="align-content:center" index="3">
          <el-icon>
            <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
              <path fill="#000000"
                    d="m19.05 21.6l-2.925-2.9l-1.5 1.5q-.275.275-.7.275t-.7-.275q-.575-.575-.575-1.425t.575-1.425l4.225-4.225q.575-.575 1.425-.575t1.425.575q.275.275.275.7t-.275.7l-1.5 1.5l2.9 2.925q.3.3.3.7t-.3.7l-1.25 1.25q-.3.3-.7.3t-.7-.3M21.7 6.2L10.65 17.25l.125.1q.575.575.575 1.425t-.575 1.425q-.275.275-.7.275t-.7-.275l-1.5-1.5l-2.925 2.9q-.3.3-.7.3t-.7-.3L2.3 20.35q-.3-.3-.3-.7t.3-.7l2.9-2.925l-1.5-1.5q-.275-.275-.275-.7t.275-.7q.575-.575 1.425-.575t1.425.575l.1.125L17.425 2.475q.275-.275.638-.425t.762-.15H21q.425 0 .713.288T22 2.9v2.575q0 .2-.075.388T21.7 6.2M6.225 10.125l-3.65-3.65Q2.3 6.2 2.15 5.838T2 5.075V2.9q0-.425.288-.712T3 1.9h2.175q.4 0 .763.15t.637.425l3.65 3.65q.3.3.3.713t-.3.712L7.65 10.125q-.3.3-.712.3t-.713-.3"></path>
            </svg>
          </el-icon>
          配装管理
        </el-menu-item>
        <el-menu-item style="align-content:center" index="4">
          <el-icon>
            <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 16 16">
              <path fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"
                    d="M1.75 2.75H10v11.5H1.75zm8.25 1l4.25 2l-4.25 7.5"></path>
            </svg>
          </el-icon>
          灌注符管理
        </el-menu-item>
        <el-menu-item style="align-content:center" index="5">
          <el-icon>
            <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
              <path fill="#000000"
                    d="M12 6q-.825 0-1.412-.587T10 4t.588-1.412T12 2t1.413.588T14 4t-.587 1.413T12 6M9 21V9H4q-.425 0-.712-.288T3 8t.288-.712T4 7h16q.425 0 .713.288T21 8t-.288.713T20 9h-5v12q0 .425-.288.713T14 22t-.712-.288T13 21v-5h-2v5q0 .425-.288.713T10 22t-.712-.288T9 21"></path>
            </svg>
          </el-icon>
          境界管理
        </el-menu-item>
      </el-menu>
    </el-aside>
    <el-main style="height: 88vh;background: white">
      <router-view/>
    </el-main>
  </el-container>
</template>

<script>
export default {
  data() {
    return {
      menuDefaultSelectIndex: sessionStorage.getItem("menuDefaultSelectIndex") || '1',
    }
  },
  methods: {
    selectMenu(index) {
      this.menuDefaultSelectIndex = index;
      sessionStorage.setItem('menuDefaultSelectIndex', index);
      let path = 'root_manage'
      switch (index) {
        case '1':
          path = 'root_manage'
          break;
        case '2':
          path = 'equipment_manage'
          break;
        case '3':
          path = 'equipment_builds_manage'
          break;
        case '4':
          path = 'inlay_manage'
          break;
        case '5':
          path = 'cultivation_manage'
          break;
        case '6':
          path = 'user_manage'
          break;
      }
      this.$router.push({name: path})
    }
  },
  created() {
    this.selectMenu(this.menuDefaultSelectIndex)
  },
  mounted() {

  }
}
</script>


<style scoped>
.el-menu-item > a:hover {
  background: transparent;
}

.el-menu-item > a {
  color: black;
}

</style>